Graphics import components can save data in several formats, including QuickDraw pictures and QuickTime Image files. This capability is only needed by applications that perform file format translation. Applications that only wish to draw the image can use the GraphicsImportDraw function.
Creates a QuickDraw picture file.
pascal ComponentResult GraphicsImportSaveAsPicture (
GraphicsImportComponent ci,
const FSSpec *fss,
ScriptCode scriptTag);
Creates a QuickTime Image file.
pascal ComponentResult GraphicsImportSaveAsQuickTimeImageFile (
GraphicsImportComponent ci,
const FSSpec *fss,
ScriptCode scriptTag);
Creates a QuickDraw picture handle.
pascal ComponentResult GraphicsImportGetAsPicture (
GraphicsImportComponent ci,
PicHandle *picture);
This function creates a new QuickDraw picture handle containing the image currently in use by the graphics import component. If possible, the image will remain in the compressed format. For example, if the image is from a JFIF file, the picture will contain compressed JPEG data. It is the responsibility of the caller to dispose of the picture handle using KillPicture .
Saves an image in a foreign file format.
pascal ComponentResult GraphicsImportExportImageFile (GraphicsImportComponent ci,
OSType fileType,
OSType fileCreator,
const FSSpec *fss,
ScriptCode scriptTag);
This function creates a new file containing the image currently in use by the graphics import component. The new file is compressed in a format corresponding to the provided file type.
If a non-identity matrix has been applied to the graphics import component, this matrix is applied to the image before export. Since most image formats don't support nonzero top-left coordinates, the matrix is temporarily adjusted to ensure that the exported image's bounds have top-left coordinates at (0,0). If the matrix does not map the graphics import component's source rectangle to a rectangle, there will be extra white space left around the image.
In QuickTime 3, the supported export file types are kQTFileTypePicture, kQTFileTypeQuickTimeImage, kQTFileTypeBMP, kQTFileTypeJPEG, and kQTFileTypePhotoshop . QuickTime 4 uses graphics exporter components to implement image export.
Returns information about available export formats.
pascal ComponentResult GraphicsImportGetExportImageTypeList (
GraphicsImportComponent ci,
QTAtomContainerPtr*);
This function creates and returns a QuickTime atom container containing information about the file types that can be exported by the graphics import component. It is the responsibility of the caller to dispose of this atom container.
In QuickTime 3, the supported export file types are kQTFileTypePicture, kQTFileTypeQuickTimeImage, kQTFileTypeBMP, kQTFileTypeJPEG, and kQTFileTypePhotoShop . For each file type, the atom container contains the following child atoms:
In QuickTime 4, the generic graphics importer builds this atom container from the values returned by the installed graphics exporter components.
The file type atom should contain an OSType; the other atoms should contain non-terminated strings.
Figure 16-5 shows a diagram of a QT atom container with the following atoms grouped.
Presents a dialog box letting the user save an image in a foreign file format.
pascal ComponentResult
GraphicsImportDoExportImageFileDialog (
GraphicsImportComponent ci,
const FSSpec *inDefaultSpec,
StringPtr prompt,
ModalFilterYDUPP filterProc,
OSType *outExportedType,
FSSpec *outExportedSpec,
ScriptCode *outScriptTag);
Retrieves settings for exported image files.
pascal ComponentResult
GraphicsImportGetExportSettingsAsAtomContainer (
GraphicsImportComponent ci,
QTAtomContainerPtr*);
Sets settings for exported image files.
pascal ComponentResult
GraphicsImportSetExportSettingsFromAtomContainer (
GraphicsImportComponent ci,
QTAtomContainer*);
| Previous | Chapter Contents | Chapter Top | Next |